//
//  MySongViewController.m
//  MusicPlayer
//
//  Created by 李欢 on 15/5/27.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "MySongViewController.h"

@interface MySongViewController ()<UITableViewDataSource,UITableViewDelegate>
@property (nonatomic, retain) UITableView * songTable;
@end

@implementation MySongViewController

- (void)dealloc
{
    [_songTable release];
    [super dealloc];
}

-(instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        self.navigationItem.title = @"全部歌曲";
    }
    return self;
}


- (void)viewDidLoad {
    [super viewDidLoad];
    
    UIBarButtonItem * rightbutton = [[UIBarButtonItem alloc] initWithTitle:@"搜索" style:UIBarButtonItemStylePlain target:self action:@selector(rightbutton:)];
    self.navigationItem.rightBarButtonItem = rightbutton;
    
        UIImageView * imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
        [imageView setImage:[UIImage imageNamed:@"back.jpg"]];
        [self.view addSubview:imageView];
    
    [self SongView];

}

//搜索按钮点击事件
-(void)rightbutton:(id)sender
{
    
}

//创建全部歌曲tableview
-(void)SongView
{
    self.songTable = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) style:UITableViewStylePlain];
    self.songTable.rowHeight = 60;
    self.songTable.alpha = 0.5;
    self.songTable.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
    self.songTable.dataSource = self;
    self.songTable.delegate = self;
    [self.view addSubview:self.songTable];
    
    
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{

    return 30;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{

    static NSString * cellIdentify = @"cell";
    UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:cellIdentify];
    if (!cell) {
        cell = [[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellIdentify] autorelease];
    }
    return cell;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];

}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
